<template>
	<!-- 首页-公告详情 -->
	<view>
		<u-navbar back-text="公告详情" :back-text-style="textStyle" back-icon-color="#000000" style="font-weight: bold;font-family: PingFang SC;"></u-navbar>
		<view style="padding: 30rpx;">
		<view style="text-align: center;">{{title}}</view>
		<view style="text-align: center;margin: 30rpx;">
			{{publishTime}}
		</view>
		<image :src="imageUrl" mode="" style="width: 100%;"></image>
		<view style="line-height: 64rpx;letter-spacing: 2rpx;text-indent:2em">
			<u-parse :html="content"></u-parse>
		</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background:{
					backgroundColor: '#fca800',
				},
				content:'',
				noticeId:'',
				title:'',
				publishTime:'',
				imageUrl:''
			}
		},
		onLoad(option) {
			let _this = this
			_this.noticeId = option.id
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'notice/detail'
			};
			let data = {
				noticeId:_this.noticeId 
			};
			_this.http.httpTokenRequest(opts,data).then(res => {
				console.log(res,"---")
				//打印请求返回的数据
				if (res.code == 200) {
					_this.content = res.data.content
					_this.title = res.data.title
					_this.publishTime = res.data.publishTime
					_this.imageUrl = res.data.imageUrl
				} else {
					_this.$refs.uToast.show({
						title: res.message,
						type: 'error',
					})
				}
			});
		},
		methods: {
		}
		
	}
</script>

<style>
</style>
